package com.authine.cloudpivot.web.api.secondopen.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.authine.cloudpivot.web.api.config.HxConfig;
import com.authine.cloudpivot.web.api.secondopen.dao.Im370sxzxkhbMapper;
import com.authine.cloudpivot.web.api.secondopen.dao.Iusi6cgbMapper;
import com.authine.cloudpivot.web.api.secondopen.domain.IdList;
import com.authine.cloudpivot.web.api.secondopen.domain.Iusi6cgb;
import com.authine.cloudpivot.web.api.secondopen.modules.*;
import com.authine.cloudpivot.web.api.secondopen.service.AssessManagementService;
import com.authine.cloudpivot.web.api.secondopen.utils.HttpRestUtil;
import com.authine.cloudpivot.web.api.utils.StringUtils;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class AssessManagenmentServiceImpl implements AssessManagementService {
    private static final Logger log = LoggerFactory.getLogger(AssessManagenmentServiceImpl.class);


    @Autowired
    private Im370sxzxkhbMapper sxzxkhbMapper;


    @Override
    public int updatePersonAssessmentStatus(IdList idList,String status) {
        if(status.equals("1")){
            //更新考核表为已被选状态
            return sxzxkhbMapper.updatePersonKhbStatus(idList);
        }else{
            //重置考核表状态
            return sxzxkhbMapper.resetPersonKhbStatus(idList);
        }

    }
}
